//
//  MyKnowingViewController.m
//  SchoolProduct
//
//  Created by 蒋松涵 on 16/9/8.
//  Copyright © 2016年 sm. All rights reserved.
//

#import "MyKnowingViewController.h"

@interface MyKnowingViewController ()<UITableViewDataSource,UITableViewDelegate>


@property(nonatomic,strong)UITableView * tableView;
@property(nonatomic,strong)NSMutableArray * dataArray;


@property(nonatomic,strong)NSString * studentName;//学生姓名
@property(nonatomic,strong)NSString * dataLabel;//日期
@property(nonatomic,strong)NSString * weekData;//周
@property(nonatomic,strong)NSString * timeLabel;//时间


@property (nonatomic,retain) NSString *urlStr;
@property (nonatomic,retain) NSDictionary *urlParameters;


@end

@implementation MyKnowingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.title = @"我的查寝";
    
//    _urlStr = @"http://www.100xsys.com.cn/school/app/noticeInfo/listJson";
//    _urlParameters = [[NSDictionary alloc]initWithObjectsAndKeys:@"1",@"appWebConfigId",@"notice",@"noticeInfo. noticeTypeCode",@"1",@"page",@"10",@"rows",@"1",@"noticeInfo. recommend", nil];
//    [self fecthDataFromNet:_urlStr parameters:_urlParameters];
    
    [self init_TableView];
}

#pragma mark - UITableView----------
-(void)init_TableView
{
    self.tableView = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self.view addSubview:self.tableView];
}

#pragma mark - UITableViewDataSource----------
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 9;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString * CellIdentifier = @"cell";
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
    cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
    cell.selectionStyle = UITableViewCellAccessoryNone;
    
    switch (indexPath.row)
    {
        case 0:
        {
            cell.backgroundColor = [UIColor greenColor];
        }
            break;
        case 1:
        {
            UILabel * nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, 10, 100, 30)];
            nameLabel.text = @"黄晓明";
            nameLabel.font = [UIFont systemFontOfSize:20];
            nameLabel.textColor = [UIColor orangeColor];
            [cell.contentView addSubview:nameLabel];
            
            cell.backgroundColor = [UIColor lightGrayColor];
        }
            break;
        case 2:
        {
            UILabel * DataLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, 10, 100, 30)];
            DataLabel.text = @"2016";
            DataLabel.textColor = [UIColor orangeColor];
            [cell.contentView addSubview:DataLabel];
            cell.backgroundColor = [UIColor yellowColor];
        }
            break;
        case 3:
        {
            
        }
            break;
        case 4:
        {
            
        }
            break;
        case 5:
        {
            
        }
            break;
        case 6:
        {
            
        }
            break;
        case 7:
        {
            
        }
            break;
        case 8:
        {
            
        }
            break;
            
        default:
            break;
    }
    
    
    
    return cell;
}

#pragma mark - UITableView的高度----------
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    switch (indexPath.row) {
        case 0:
        {
            return 40;
        }
            break;
        case 1:
        {
            return 60;
        }
            break;
        case 2:
        {
            return 50;
        }
            break;
        case 3:
        {
            return 50;
        }
            break;
        case 4:
        {
            return 50;
        }
            break;
        case 5:
        {
            return 50;
        }
            break;
        case 6:
        {
            return 50;
        }
            break;
        case 7:
        {
            return 50;
        }
            break;
        case 8:
        {
            return 50;
        }
            break;
        default:
            break;
    }
    return 0;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
